//
//  BSBaseModel.m
//  BaiSiBuDeJie
//
//  Created by bill on 16/8/25.
//  Copyright © 2016年 tsaievan. All rights reserved.
//

#import "BSBaseModel.h"
#import <AFHTTPSessionManager.h>

@interface BSBaseModel ()

@end

@implementation BSBaseModel






//下载数据方法
+(void)downDataWithUrl:(NSString*)url successBlock:(void(^)( BSBaseModel*model))successBlock failBlock:(void(^)(NSError* err))failBlcok
{
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
   [manager GET:url parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
       
       NSDictionary *dic = responseObject;
      
     BSBaseModel *model =  [BSBaseModel mj_objectWithKeyValues:dic];
             if (successBlock) {
           successBlock(model);
       }
       
   } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
       
       if (failBlcok) {
           failBlcok(error);
       }
       NSLog(@"下载失败%@",error);
   }];
    
   
}

+ (NSDictionary *)objectClassInArray{
    return @{@"list" : [ListModel class]};
}
@end



@implementation InfoModel

@end


@implementation ListModel

+ (NSDictionary *)objectClassInArray{
    return @{@"tags" : [TagsModel class]};
}

@end


@implementation UModel

@end


@implementation VideoModel

@end

@implementation GifModel

@end

@implementation TagsModel

@end

@implementation ImageModel

@end

@implementation AudioModel

@end
